package com.spzx.cart.api;

import com.spzx.cart.api.domain.CartInfo;
import com.spzx.cart.api.factory.RemoteCartFallbackFactory;
import com.spzx.common.core.constant.SecurityConstants;
import com.spzx.common.core.constant.ServiceNameConstants;
import com.spzx.common.core.domain.R;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

/**
 * @Author 快点干早点散
 * @Create 2025/5/9 19:07
 * Description:
 */
@FeignClient(
        //注册中心 指定要调用的微服务名称
        value =  ServiceNameConstants.CART_SERVICE,
        //指定熔断降级处理的工厂类
        fallbackFactory = RemoteCartFallbackFactory.class)
public interface RemoteCartService {

    @Operation(summary = "查询当前购物车中勾选商品列表")
    @GetMapping("/getCartCheckedList")
    R<List<CartInfo>> getCartCheckedList(
            @RequestHeader(SecurityConstants.FROM_SOURCE)String source);


}
